import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/dashboard',
      name: 'Dashboard',
      component: () => import('@/views/Dashboard.vue'),
      children: [
        {
          path: 'welcome',
          name: 'Welcome',
          component: () => import('@/views/Welcome.vue')
        },
        {
          path: 'user',
          name: 'User',
          component: () => import('@/views/user/User.vue'),
          children: [
            {
              path: 'index',
              name: 'Index',
              component: () => import('@/views/user/Index.vue')
            }
          ]
        }
      ]
    },
  ]
})

export default router
